<script setup >
import {computed,ref} from 'vue'
// 调用computed函数创建计算属性
const count =computed (()=>{
  return 100
})
// 定义一个响应式数据
const scores = ref ([80, 100, 90, 70, 60])
// >80
const goods = computed(()=>{
  return scores.value.filter(item=>item>80)
})

</script>

<template>
 <h1>{{count}}</h1>
 <button @click="scores.push(Math.floor(Math.random()*20)+70)">添加</button>
 <h1>{{goods}}</h1>
</template>
<style>
</style>